/*
 * PlayerMotionController.h
 *
 *  Created on: Jun 30, 2010
 *      Author: Ry
 */

#ifndef PLAYERMOTIONCONTROLLER_H_
#define PLAYERMOTIONCONTROLLER_H_

#include "Object.h"
#include "MotionController.h"

class PlayerMotionController: public MotionController {
protected:
	Object *player;

	float maxVelocity;
	float sensitivity;
	float constantResist;
	float proportionalResist;

	float pitch;
	float yaw;

	bool moveForward;
	bool moveBackward;
	bool strafeLeft;
	bool strafeRight;

	void handleRotation(float dts);
	void handleMovement(float dts);

public:
	PlayerMotionController(Object *player);
	void step(float dts);
	virtual ~PlayerMotionController();

	float getConstantResist() const {
		return constantResist;
	}

	float getMaxVelocity() const {
		return maxVelocity;
	}

	bool getMoveBackward() const {
		return moveBackward;
	}

	bool getMoveForward() const {
		return moveForward;
	}

	float getPitch() const {
		return pitch;
	}

	Object *getPlayer() const {
		return player;
	}

	float getProportionalResist() const {
		return proportionalResist;
	}

	float getSensitivity() const {
		return sensitivity;
	}

	bool getStrafeLeft() const {
		return strafeLeft;
	}

	bool getStrafeRight() const {
		return strafeRight;
	}

	float getYaw() const {
		return yaw;
	}

	void setConstantResist(float constantResist) {
		this->constantResist = constantResist;
	}

	void setMaxVelocity(float maxVelocity) {
		this->maxVelocity = maxVelocity;
	}

	void setMoveBackward(bool moveBackward) {
		this->moveBackward = moveBackward;
	}

	void setMoveForward(bool moveForward) {
		this->moveForward = moveForward;
	}

	void setPitch(float pitch) {
		this->pitch = pitch;
	}

	void setPlayer(Object *player) {
		this->player = player;
	}

	void setProportionalResist(float proportionalResist) {
		this->proportionalResist = proportionalResist;
	}

	void setSensitivity(float sensitivity) {
		this->sensitivity = sensitivity;
	}

	void setStrafeLeft(bool strafeLeft) {
		this->strafeLeft = strafeLeft;
	}

	void setStrafeRight(bool strafeRight) {
		this->strafeRight = strafeRight;
	}

	void setYaw(float yaw) {
		this->yaw = yaw;
	}

};

#endif /* PLAYERMOTIONCONTROLLER_H_ */
